Sunan at-Tirmithiy كتاب الصلاة باب ما يقول إذا سلم من الصلاة

حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدِ بْنِ مُوسَى حَدَّثَنَا عَبْدُ اللَّهِ بْنُ الْمُبَارَكِ أَخْبَرَنَا الأَوْزَاعِىُّ حَدَّثَنِى شَدَّادٌ أَبُو عَمَّارٍ حَدَّثَنِى أَبُو أَسْمَاءَ الرَّحَبِىُّ قَالَ حَدَّثَنِى ثَوْبَانُ مَوْلَى رَسُولِ اللَّهِ صلى الله عليه وسلم قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِذَا أَرَادَ أَنْ يَنْصَرِفَ مِنْ صَلاَتِهِ اسْتَغْفَرَ اللَّهَ ثَلاَثَ مَرَّاتٍ ثُمَّ قَالَ اللَّهُمَّ أَنْتَ السَّلاَمُ وَمِنْكَ السَّلاَمُ تَبَارَكْتَ يَا ذَا الْجَلاَلِ وَالإِكْرَام. قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ. وَأَبُو عَمَّارٍ اسْمُهُ شَدَّادُ بْنُ عَبْدِ اللَّهِ.
The Messenger of God, peace and blessings of God be upon him, when ending his prayer (1), would ask God for His forgiveness three times and then say, "O God, You are The Perfection and the source of wholesomeness (2); Blessed are You, Lord of Majesty and Honor." Footnotes: (1) In the prescribed way to finish the prayer, i.e. saying "(may) God's peace, blessings and mercy be upon you." (2) Freedom from fault and defect. Click on ḥadīth to read more